package com.maxjay.component.metadata.core.generator;

import com.maxjay.component.metadata.constant.GeneratorEnableType;
import com.maxjay.component.metadata.model.Entity;
import com.maxjay.component.metadata.model.Record;

public abstract class AbstractFieldValueGenerator implements FieldValueGenerator {
	
	private GeneratorEnableType generateType = GeneratorEnableType.onSave;
	
	public AbstractFieldValueGenerator() {
	}
	
	public AbstractFieldValueGenerator(GeneratorEnableType generateType) {
		this.generateType = generateType;
	}

	@Override
	public GeneratorEnableType getEnableType() {
		return generateType;
	}

	@Override
	public abstract String generateValue(Entity entity, Record record);

	public void setGenerateType(GeneratorEnableType generateType) {
		this.generateType = generateType;
	}

}
